package com.demo.schedule.his;

import com.demo.mapper.HisMapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;

@Slf4j
@Component
public class SyncHisDataSchedule {

    @Autowired
    private ScheduledExecutorService scheduledExecutorService;

    @PostConstruct
    public void syncData() {
        scheduledExecutorService.scheduleAtFixedRate(new SyncHisDataThread(), 0L, 1, TimeUnit.MINUTES);
    }
}
